1 from __main__ import *
2 import sys

3
4 try
:
5     
from Tkinter import *
6 except ImportError:
7     
from tkinter import *
8
9 try
:
10     import ttk
11     py3 = False
12 except ImportError:
13     import tkinter.ttk
as ttk
14     py3 = True
15
16 fo1=open(
"receipt.txt","r")
17 list1=fo1.readlines()
18
19 del list1[
1]
20 del list1[
2]
21 del list1[
3]
22 del list1[
4]
23 del list1[
5]
24 list1[
0]=list1[0][:-1]
25 list1[
1]=list1[1][:-1]
26 list1[
2]=list1[2][:-1]
27 list1[
3]=list1[3][:-1]
28 list1[
4]=list1[4][:-1]
29
30 p=
'''
31 ========== Hotel Management System ==========
32
33 NAME-%s
34 ADDRESS-%s
35 MOBILE NO.-%s
36 YOUR TOTAL BILL IS $-%s
37 YOUR ROOM NUMBER IS %s
38      
39      
40      

41 '''%(list1[
0],list1[1],list1[2],list1[4],list1[3])
42
43         

44
45
46
47
48
49 class
recipt:
50     def __init__(self):
51         root=Tk()
52         
'''This class configures and populates the toplevel window.
53            top
is the toplevel containing window.'''
54         _bgcolor =
'#d9d9d9' # X11 color: 'gray85'
55         _fgcolor =
'#000000' # X11 color: 'black'
56         _compcolor =
'#d9d9d9' # X11 color: 'gray85'
57         _ana1color =
'#d9d9d9' # X11 color: 'gray85'
58         _ana2color =
'#d9d9d9' # X11 color: 'gray85'
59
60         root.geometry(
"800x800")
61         root.title(
"receipt")
62         root.configure(background=
"#d9d9d9")
63
64
65
66         self.Label1 = Label(root)
67         self.Label1.configure(background=
"#d9d9d9")
68         self.Label1.place(relx=
0, rely=0, height=800, width=800)
69         self.Label1.configure(disabledforeground=
"#a3a3a3")
70         self.Label1.configure(foreground=
"#000000")
71         self.Label1.configure(text=p)
72         self.Label1.configure(anchor=N)
73
74         self.Label1.configure(wraplength=
1000)
75         self.Label1.configure(justify =LEFT)
76
77         self.Label1.configure(width=
582)
78         root.mainloop()

79
80
81 if
__name__ == '__main__':
82     recipt1=recipt()


Gõ tìm kiếm nhanh...